//
//	TempCurveItem.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "TempCurveItem.h"

NSString *const kTempCurveItemTemp = @"temp";
NSString *const kTempCurveItemTime = @"time";

@interface TempCurveItem ()

@end


@implementation TempCurveItem


/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kTempCurveItemTemp] isKindOfClass:[NSNull class]]){
		self.temp = [dictionary[kTempCurveItemTemp] floatValue];
	}

	if(![dictionary[kTempCurveItemTime] isKindOfClass:[NSNull class]]){
		self.time = dictionary[kTempCurveItemTime];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	dictionary[kTempCurveItemTemp] = @(self.temp);
	if(self.time != nil){
		dictionary[kTempCurveItemTime] = self.time;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:@(self.temp) forKey:kTempCurveItemTemp];	if(self.time != nil){
		[aCoder encodeObject:self.time forKey:kTempCurveItemTime];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.temp = [[aDecoder decodeObjectForKey:kTempCurveItemTemp] floatValue];
	self.time = [aDecoder decodeObjectForKey:kTempCurveItemTime];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	TempCurveItem *copy = [TempCurveItem new];

	copy.temp = self.temp;
	copy.time = [self.time copy];

	return copy;
}
@end
